package com.example.lxj.LegalCase.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.LegalCase.mapper.TbConsulationMapper;
import com.example.lxj.LegalCase.entity.TbConsulation;
import com.example.lxj.LegalCase.service.ITbConsulationService;

/**
 * 委托咨询Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-23
 */
@Service
public class TbConsulationServiceImpl implements ITbConsulationService 
{
    @Autowired
    private TbConsulationMapper tbConsulationMapper;

    /**
     * 查询委托咨询
     * 
     * @param id 委托咨询主键
     * @return 委托咨询
     */
    @Override
    public TbConsulation selectTbConsulationById(Long id)
    {
        return tbConsulationMapper.selectTbConsulationById(id);
    }

    /**
     * 查询委托咨询列表
     * 
     * @param tbConsulation 委托咨询
     * @return 委托咨询
     */
    @Override
    public List<TbConsulation> selectTbConsulationList(TbConsulation tbConsulation)
    {
        return tbConsulationMapper.selectTbConsulationList(tbConsulation);
    }

    /**
     * 新增委托咨询
     * 
     * @param tbConsulation 委托咨询
     * @return 结果
     */
    @Override
    public int insertTbConsulation(TbConsulation tbConsulation)
    {
        tbConsulation.setCreateTime(DateUtil.date());
        return tbConsulationMapper.insertTbConsulation(tbConsulation);
    }

    /**
     * 修改委托咨询
     * 
     * @param tbConsulation 委托咨询
     * @return 结果
     */
    @Override
    public int updateTbConsulation(TbConsulation tbConsulation)
    {
        tbConsulation.setUpdateTime(DateUtil.date());
        return tbConsulationMapper.updateTbConsulation(tbConsulation);
    }

    /**
     * 批量删除委托咨询
     * 
     * @param ids 需要删除的委托咨询主键
     * @return 结果
     */
    @Override
    public int deleteTbConsulationByIds(Long[] ids)
    {
        return tbConsulationMapper.deleteTbConsulationByIds(ids);
    }

    /**
     * 删除委托咨询信息
     * 
     * @param id 委托咨询主键
     * @return 结果
     */
    @Override
    public int deleteTbConsulationById(Long id)
    {
        return tbConsulationMapper.deleteTbConsulationById(id);
    }
}
